home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************************
- ** **
- ** Module: QD3DWinViewer.h **
- ** **
- ** Purpose: WinViewer Controller Interface File. **
- ** **
- ** Copyright (C) 1996 Apple Computer, Inc. All rights reserved. **
- ** **
- *****************************************************************************/
-
- #ifndef QD3DWinViewer_h
- #define QD3DWinViewer_h
-
- #include "QD3D.h"
- #include "QD3DGroup.h"
-
- #if defined(OS_WIN32) && OS_WIN32
-
- #include <windows.h>
-
- #if defined(_MSC_VER) /* Microsoft Visual C */
- #if defined(Q3VIEWER_EXPORTING) // define when building DLL
- #define Q3VIEWER_EXPORT __declspec( dllexport )
- #define Q3VIEWER_API
- #else
- #define Q3VIEWER_EXPORT __declspec( dllimport )
- #define Q3VIEWER_API __cdecl
- #endif //WIN32_EXPORTING
- #else
- #define Q3VIEWER_EXPORT
- #define Q3VIEWER_API
- #endif /* _MSC_VER */
-
- typedef void *TQ3ViewerObject;
-
- typedef TQ3Status (Q3VIEWER_API *TQ3WinViewerDrawingCallbackMethod)(
- TQ3ViewerObject theViewer,
- const void *data);
-
- enum {
- kQ3ViewerShowBadge = 1<<0,
- kQ3ViewerActive = 1<<1,
- kQ3ViewerControllerVisible = 1<<2,
- kQ3ViewerDrawFrame = 1<<3,
- kQ3ViewerDraggingOff = 1<<4,
-
- kQ3ViewerButtonCamera = 1<<5,
- kQ3ViewerButtonTruck = 1<<6,
- kQ3ViewerButtonOrbit = 1<<7,
- kQ3ViewerButtonZoom = 1<<8,
- kQ3ViewerButtonDolly = 1<<9,
- kQ3ViewerButtonReset = 1<<10,
-
- kQ3ViewerOutputTextMode = 1<<11,
- kQ3ViewerDragMode = 1<<12,
-
- kQ3ViewerDrawGrowBox = 1<<13,
- kQ3ViewerDrawDragBorder = 1<<14,
-
- kQ3ViewerDraggingInOff = 1<<15,
- kQ3ViewerDraggingOutOff = 1<<16,
-
- kQ3ViewerDefault = 1<<31
- };
-
-
- enum {
- kQ3ViewerEmpty = 0,
- kQ3ViewerHasModel = 1<<0,
- kQ3ViewerHasUndo = 1<<1
- };
-
- typedef enum TQ3ViewerCameraView {
- kQ3ViewerCameraRestore,
- kQ3ViewerCameraFit,
- kQ3ViewerCameraFront,
- kQ3ViewerCameraBack,
- kQ3ViewerCameraLeft,
- kQ3ViewerCameraRight,
- kQ3ViewerCameraTop,
- kQ3ViewerCameraBottom
- } TQ3ViewerCameraView;
-
- #ifdef __cplusplus
- extern "C" {
- #endif /* __cplusplus */
-
- /*Q3VIEWER_EXPORT ATOM Q3WinInitializeViewerWindowClass (HANDLE hInstance);*/
-
- /******************************************************************************
- ** **
- ** Win32 Window Class Name **
- ** Can be passed as a parameter to CreateWindow or CreateWindowEx **
- ** **
- *****************************************************************************/
-
- #define kQ3ViewerClassName "QD3DViewerWindow"
-
- /******************************************************************************
- ** **
- ** Creation and destruction **
- ** Note that this is not a QuickDraw 3D object **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3ViewerObject Q3VIEWER_API Q3WinViewerNew (
- HWND window,
- const RECT *rect,
- unsigned long flags);
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerDispose(
- TQ3ViewerObject theWinViewer);
-
- /******************************************************************************
- ** **
- ** Functions to attach data to a WinViewer **
- ** **
- *****************************************************************************/
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerUseFile(
- TQ3ViewerObject theWinViewer,
- HANDLE fileHandle);
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerUseUnixPath (
- TQ3ViewerObject theWinViewer,
- char *filePath); /* temporary until we have a win storage */
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerUseData(
- TQ3ViewerObject theWinViewer,
- void *data,
- unsigned long size);
-
- /******************************************************************************
- ** **
- ** Functions to write data out from the WinViewer **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerWriteUnixPath (
- TQ3ViewerObject theWinViewer,
- char *filePath);
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerWriteFile(
- TQ3ViewerObject theWinViewer,
- HANDLE fileHandle);
-
- Q3VIEWER_EXPORT unsigned long Q3VIEWER_API Q3WinViewerWriteData(
- TQ3ViewerObject theWinViewer,
- void **data);
-
- /******************************************************************************
- ** **
- ** Use this function to force the WinViewer to re-draw **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerDraw(
- TQ3ViewerObject theWinViewer);
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerDrawContent(
- TQ3ViewerObject theViewer);
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerDrawControlStrip(
- TQ3ViewerObject theViewer);
-
-
- /******************************************************************************
- ** **
- ** Function used by the WinViewer to filter and handle events **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT BOOL Q3VIEWER_API Q3WinViewerMouseDown(
- TQ3ViewerObject theWinViewer,
- long x,
- long y);
-
- Q3VIEWER_EXPORT BOOL Q3VIEWER_API Q3WinViewerContinueTracking(
- TQ3ViewerObject theWinViewer,
- long x,
- long y);
-
- Q3VIEWER_EXPORT BOOL Q3VIEWER_API Q3WinViewerMouseUp(
- TQ3ViewerObject theWinViewer,
- long x,
- long y);
-
- /* TBD: Re-parameterize using params from WM_CHAR and WM_KEYDOWN, WM_KEYUP
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerKeyDown(
- TQ3ViewerObject theWinViewer,
- unsigned char keyCode,
- unsigned short characterCode,
- unsigned short flags);
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerKeyUp(
- TQ3ViewerObject theWinViewer,
- unsigned char keyCode,
- unsigned short characterCode,
- unsigned short flags);
- */
-
-
- /******************************************************************************
- ** **
- ** This function returns a Bitmap of the contents of the **
- ** WinViewer's window. The application should dispose the Bitmap. **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT HBITMAP Q3VIEWER_API Q3WinViewerGetBitmap(
- TQ3ViewerObject theWinViewer);
-
- /******************************************************************************
- ** **
- ** Calls for dealing with Buttons **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerGetButtonRect(
- TQ3ViewerObject theWinViewer,
- unsigned long button,
- RECT *rectangle);
-
- Q3VIEWER_EXPORT unsigned long Q3VIEWER_API Q3WinViewerGetCurrentButton(
- TQ3ViewerObject theWinViewer);
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerSetCurrentButton(
- TQ3ViewerObject theWinViewer,
- unsigned long button);
-
- /******************************************************************************
- ** **
- ** Functions to set/get the group to be displayed by the WinViewer. **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerUseGroup(
- TQ3ViewerObject theWinViewer,
- TQ3GroupObject group);
-
- Q3VIEWER_EXPORT TQ3GroupObject Q3VIEWER_API Q3WinViewerGetGroup(
- TQ3ViewerObject theWinViewer);
-
- /******************************************************************************
- ** **
- ** Functions to set/get the color used to clear the window **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerSetBackgroundColor(
- TQ3ViewerObject theWinViewer,
- TQ3ColorARGB *color);
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerGetBackgroundColor(
- TQ3ViewerObject theWinViewer,
- TQ3ColorARGB *color);
-
- /******************************************************************************
- ** **
- ** Getting/Setting a WinViewer's View object. Disposal is needed. **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3ViewObject Q3VIEWER_API Q3WinViewerGetView(
- TQ3ViewerObject theWinViewer);
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerRestoreView(
- TQ3ViewerObject theWinViewer);
-
- /******************************************************************************
- ** **
- ** Calls for setting/getting WinViewer flags **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerSetFlags(
- TQ3ViewerObject theWinViewer,
- unsigned long flags);
-
- Q3VIEWER_EXPORT unsigned long Q3VIEWER_API Q3WinViewerGetFlags(
- TQ3ViewerObject theWinViewer);
-
- /******************************************************************************
- ** **
- ** Calls related to bounds/dimensions. Bounds is the size of **
- ** the window. Dimensions can either be the Rect from the ViewHints **
- ** or the current dimensions of the window (if you do a Set). **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerSetBounds(
- TQ3ViewerObject theWinViewer,
- RECT *bounds);
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerGetBounds(
- TQ3ViewerObject theWinViewer,
- RECT *bounds);
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerSetDimension(
- TQ3ViewerObject theViewer,
- unsigned long width,
- unsigned long height);
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerGetDimension(
- TQ3ViewerObject theWinViewer,
- unsigned long *width,
- unsigned long *height);
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerGetMininumDimension(
- TQ3ViewerObject theViewer,
- unsigned long *width,
- unsigned long *height);
-
- /******************************************************************************
- ** **
- ** Window related calls **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerSetWindow(
- TQ3ViewerObject theWinViewer,
- HWND aWindow);
-
- Q3VIEWER_EXPORT HWND Q3VIEWER_API Q3WinViewerGetWindow(
- TQ3ViewerObject theWinViewer);
-
- Q3VIEWER_EXPORT TQ3ViewerObject Q3VIEWER_API Q3WinViewerGetViewer(
- HWND theWindow);
-
-
- /******************************************************************************
- ** **
- ** Adjust Cursor should be called from idle loop to allow the WinViewer **
- ** to change the cursor according to the cursor position/object under **
- ** the cursor. **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Boolean Q3VIEWER_API Q3WinViewerAdjustCursor(
- TQ3ViewerObject theWinViewer,
- long x,
- long y);
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerCursorChanged(
- TQ3ViewerObject theViewer);
-
- /******************************************************************************
- ** **
- ** Returns the state of the WinViewer. See the constant defined at the **
- ** top of this file. **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT unsigned long Q3VIEWER_API Q3WinViewerGetState(
- TQ3ViewerObject theWinViewer);
-
- /******************************************************************************
- ** **
- ** Clipboard utilities **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerClear(
- TQ3ViewerObject theWinViewer);
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerCut(
- TQ3ViewerObject theWinViewer);
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerCopy(
- TQ3ViewerObject theWinViewer);
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerPaste(
- TQ3ViewerObject theWinViewer);
-
- /******************************************************************************
- ** **
- ** Drawing CallBack **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerSetDrawingCallbackMethod(
- TQ3ViewerObject theViewer,
- TQ3WinViewerDrawingCallbackMethod callbackMethod,
- const void *data);
-
- /******************************************************************************
- ** **
- ** Undo **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerUndo(
- TQ3ViewerObject theViewer);
-
- TQ3Boolean Q3VIEWER_API Q3WinViewerGetUndoString(
- TQ3ViewerObject theViewer,
- char *string,
- unsigned long *cnt);
-
- /******************************************************************************
- ** **
- ** New Camera Stuff **
- ** **
- *****************************************************************************/
-
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerGetCameraCount(
- TQ3ViewerObject theViewer,
- unsigned long *cnt);
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerSetCameraNumber(
- TQ3ViewerObject theViewer,
- unsigned long cameraNo);
-
- Q3VIEWER_EXPORT TQ3Status Q3VIEWER_API Q3WinViewerSetCameraView(
- TQ3ViewerObject theViewer,
- TQ3ViewerCameraView viewType);
-
- #ifdef __cplusplus
- }
- #endif /* __cplusplus */
-
- #endif /* OS_WINDOWS */
-
- #endif /* QD3DWinViewer_h */
-
-